from PIL import Image

image = Image.open("example.jpg")

# 定义裁剪区域 (left, upper, right, lower)
box = (100, 100, 400, 400)
cropped_image = image.crop(box)

# 保存裁剪后的图像
cropped_image.save("cropped_example.jpg")